#ifndef CELL_H
#define CELL_H
 
#include<iostream>
#include<cmath>
#include "Common.h"

#define Q_DIM 	9

#define c1		(-2)
#define alpha2	(-8)
#define alpha3	(4) //BGK
#define gamma1	(2./3.)
#define gamma2	(18)
#define gamma3	(2./3.)
#define gamma4	(-18) //BGK

enum momentum {
	iRHO=0, iE, iEPSILON, iJX, iQX, iJY, iQY, iPXX, iPXY
};

class Cell {
	private:
		static const double M[Q_DIM][Q_DIM];
		static const double Minv[Q_DIM][Q_DIM];
		static double meq[Q_DIM];
		static double m[Q_DIM];

		void calcMomenta();
		void calcDF();
		void calcEQ();

	public:
		double f[Q_DIM];
		static double s[Q_DIM];
		double rho;
		vec<double> u;
		bool isObstacle;

		Cell(void);
		void collide();
		void collide(vec<double> _u);
		void updateRhoAndU(void);

		static void setS(double se, double seps, double schi, double sq, double snu);
		void setU(vec<double>& _u, double dxux, double dyux, double dyuy, double dxuy, double _rho);
		void addU(vec<double>& _u);
		void multU(double factor);
};

#endif
